#include "websocket_respond.h"
#include <stdio.h>
#include <string.h>

Websocket_Respond::Websocket_Respond() { }

Websocket_Respond::~Websocket_Respond() { }


unsigned int Websocket_Respond::build_websocket_msg(char* buf, unsigned int len)
{
	unsigned char  msg[2048];
	msg[0] = 0xFF & 0x81;
	msg[1] = 0x7F & len;

	memcpy(msg+2, buf, len);
	memcpy(buf, msg, len + 2);

	return len + 2;
}